<template>
  <div class="tip_box">
    <div class="box">
      {{ tipData.msg }}
    </div>
  </div>
</template>

<script>
export default {
  name: 'TipBox',
  props: {
    tipData: {
      type: Object,
      default: null
    }
  },
  data () {
    return {
    }
  },
  computed: {},
  mounted () {
    setTimeout(this.timelyFun, this.tipData.time || 3000)
  },
  methods: {
    timelyFun () {
      this.tipData.tipState = false
    }
  }
}
</script>

<style lang="scss" scoped>
.tip_box {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  .box {
    background: rgba(0, 0, 0, 0.8);
    font-size: 16px;
    padding: 20px;
    color: #ffffff;
    border-radius: 5px;
  }
}
</style>
